


$(function() {
	var e = $(".relevant");
	
	var t = function(e, t) {
			$.each(e, function(e, n) {
				if (t == e) $(n).fadeIn();
				else $(n).hide()
			})
		},
		n = $(".relevant .v_content ul"),
		a = $(".pages span.perv"),
		i = $(".pages span.nextpage"),
		l = $(".pages span.next"),
		s = function(e, t) {
			return n.eq(e).attr("i", t)
		},
		o = function(e, t, n) {
			if (n) e.addClass(t);
			else e.removeClass(t)
		},
		c = {
			p: function(e, t) {
				if (typeof e != "undefined") e.click(function() {
					var e = n.eq(t).attr("i"),
						s = a.eq(t),
						c = l.eq(t),
						r = i.eq(t).children("span");
					if (e != 0 && e != "") {
						e--;
						o(c, "next_disabled", false), o(r, "cur", false), o(r.eq(e), "cur", true);
						n.eq(t).attr("i", e), n.eq(t).css("left", -(e * 270))
					} else o(s, "prev_disabled", true)
				})
			},
			m: function(e, t) {
				if (typeof e != "undefined") e.children("span").each(function(i, s) {
					$(this).mouseover(function() {
						var s = a.eq(t),
							c = l.eq(t);
						e.children("span").removeClass("cur").eq(i).addClass("cur"), n.eq(t).css("left", -(270 * i)).attr("i", i);
						if (i == 0) o(s, "prev_disabled", true), o(c, "next_disabled", false);
						else if (i == 4) o(c, "next_disabled", true), o(s, "prev_disabled", false);
						else o(s, "prev_disabled", false), o(c, "next_disabled", false)
					})
				})
			},
			n: function(e, t) {
				if (typeof e != "undefined") e.click(function() {
					var e = n.eq(t).attr("i"),
						s = a.eq(t),
						c = l.eq(t),
						r = i.eq(t).children("span");
					if (e != 4 && e != "") {
						e++;
						o(s, "prev_disabled", false), o(r, "cur", false), o(r.eq(e), "cur", true);
						n.eq(t).css("left", -(e * 270)), n.eq(t).attr("i", e)
					} else o(c, "next_disabled", true)
				})
			}
		};
	e.find("div.pages").each(function(e, t) {
		n.eq(e).attr("i", 0), $(this).children("span.perv").each(function() {
			c.p($(this), e)
		}), $(this).children("span.nextpage").each(function() {
			c.m($(this), e)
		}), $(this).children("span.next").each(function() {
			c.n($(this), e)
		})
	});
	
});
